﻿using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System;

namespace HobSoft.SoccerBet2014.Domain.Models
{
    using Core;
    using KeyHelper;
    [Serializable]
    [DataContract]
    public class Tournament : IModel
    {

        [PrimaryKey]
        [DataMember(IsRequired = true)]
        public string Key
        {
            get { return KeyGenerateHelper.Create<Tournament>(this); }
            set { ; }
        }

        private byte _bmId;
        [Key]
        [Required]
        [DataMember(IsRequired = true)]
        public byte BmID
        {
            get { return _bmId; }
            set { _bmId = value; }
        }

        private int _id;
        [Key]
        [Required]
        [DataMember(IsRequired = true)]
        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name;
        [Required]
        [MaxLength(50)]
        [MinLength(1)]
        [DataMember(IsRequired = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

    }
}
